#题目一：使用while 和for in 分别输出四种久久乘法表效果

print("="*30,"第一种for in 方法（左上角）","="*30)
for i in range(10):
    for j in range(1,i+1):
        print ("{}*{}={:<6}".format(i,j,i*j),end= "")
    print(" ")


print("="*30,"第二种for in 方法（左下角）","="*30)
for a in range(9,0,-1):
    for b in range(1,a+1):
        print ("{}*{}={:<6}".format(a,b,a*b),end= "")
    print("  ")


print("="*30,"第三种for in 方法（右上角）","="*30)
for c in range(0,10):
    for d in  range(1,10-c):
        print ("          ",end = "")
    for e in range(1,c+1):
        print ("{}*{}={:<6}".format(c,e,c*e),end= "")
    print("  ")
  
    
print("="*30,"第四种for in 方法（右下角）","="*30)
for f in range(9,-1,-1):
    for x in  range(1,10-f):
        print ("          ",end = "")
    for h in range(1,f+1):
        print ("{}*{}={:<6}".format(f,h,f*h),end= "")
    print("  ")



print("="*30,"第五种while方法（左上角）","="*30)
j_Bywhile =1
while j_Bywhile< 10:
    i_Bywhile =1
    while  i_Bywhile <=j_Bywhile:
        print ("{}*{}={:<6}".format(i_Bywhile,j_Bywhile,i_Bywhile*j_Bywhile),end= "")
        i_Bywhile = i_Bywhile+1
    print("")
    j_Bywhile  = j_Bywhile +1



print("="*30,"第六种while方法（左下角）","="*30)
a_Bywhile =9
while a_Bywhile>0:
    b_Bywhile =1
    while  b_Bywhile <=a_Bywhile:
        print ("{}*{}={:<6}".format(b_Bywhile,a_Bywhile,b_Bywhile*a_Bywhile),end= "")
        b_Bywhile = b_Bywhile+1
    print("")
    a_Bywhile  = a_Bywhile -1
    


print("="*30,"第七种while方法（右上角）","="*30)
i7 =1
while i7<10:
    j7=1
    while j7 <10- i7:
        print ("          ",end = "")
        j7=j7+1
    k7 =1
    while  k7 < i7+1:
        print ("{}*{}={:<6}".format(i7,k7,i7*k7),end= "")
        k7 = k7+1
    print("")
    i7  = i7+1

    
print("="*30,"第八种while方法（右下角）","="*30)
i8 =9
while i8>0:
    j8=1
    while j8<10- i8:
        print ("          ",end = "")
        j8=j8+1
    k8 =1
    while  k8 < i8+1:
        print ("{}*{}={:<6}".format(i8,k8,i8*k8),end= "")
        k8 = k8+1
    print("")
    i8  = i8-1